package com.jubao.ejb.business;

import java.util.HashMap;
import java.util.List;

import com.jubao.ejb.entity.Website;

public interface WebsiteBusiness {

	/**
	 * get websites who are member of areaCategory and businessCategory
	 * 
	 * @param areaCategorySysId
	 * @param websiteCategorySysId
	 * @param pgno
	 * @param pgsize
	 * @return
	 */
	public List<Website> getWebsiteList(long areaCategorySysId, long websiteCategorySysId, int pgno, int pgsize);

	/**
	 * get count of websites who are member of areaCategory and businessCategory
	 * 
	 * @param areaCategorySysId
	 * @param websiteCategorySysId
	 * @return
	 */
	public long getWebsiteCount(long areaCategorySysId, long websiteCategorySysId);

	/**
	 * get related website information related to website identified by url
	 * 
	 * @param url
	 * @param maxRelatedSiteNum
	 * @return HashMap with  
	 * 		site[ArrayList<Website>],	s2c[ArrayList<GeneRelation> of website to category],
	 * 		primarypath[ArrayList<Category>],	primaryareapath[ArrayList<Category>]
	 */
	public HashMap<String, Object> getRelatedWebsiteInfo(String url, int maxRelatedSiteNum);

	public Website registerWebsite(String url);

	/**
	 * add website as member of the primary category trail of categorySysId
	 * @param websiteSysId
	 * @param categorySysId
	 */
	public void add2CateogryTrail(long websiteSysId, long categorySysId);

	/**
	 * remove website from member of the primary category trail of categorySysId
	 * 
	 * @param websiteSysId
	 * @param categorySysId
	 */
	public void removeFromCategoryTrail(long websiteSysId, long categorySysId);

	/**
	 * get new registered website list
	 * 
	 * @param pgno
	 * @param pgsize
	 * @return
	 */
	public List<Website> getNewRegisteredWebsiteList(int pgno, int pgsize);

	/**
	 * get count of new registered website 
	 * @return
	 */
	public long getNewRegisteredWebsiteCount();

	/**
	 * save website, if website primarycategory is null, then set its status to IS_APPROVING waiting for servant to approve
	 * @param website
	 * @return
	 */
	public Website saveWebSiteProfile(Website website);
}
